package com.aizhixin.lab.docs.entity;

import com.aizhixin.lab.course.template.entity.TemplateChapter;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.List;

@Entity(name = "d_doc_menu")
@ToString
public class DocMenu {
    @Id
    @Column(name = "id")
    @Getter
    @Setter
    private String id;
    @Column(name = "parent_id")
    @Getter
    @Setter
    private String parentId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId", fetch = FetchType.EAGER)
    @OrderBy("orderNo ASC")
    @Getter
    @Setter
    private List<DocMenu> childrens;
    @Column(name = "name")
    @Getter
    @Setter
    private String name;
    @Column(name = "menu_no")
    @Getter
    @Setter
    private String menuNo;
    @Column(name = "order_no")
    @Getter
    @Setter
    private Integer orderNo;
    @Column(name = "type")
    @Getter
    @Setter
    private Integer type;//1:管理员 2:教师 3:学生

}
